define(['highcharts', 'crossingSpecificValue', './../initial'], function() {
    var app = angular.module('App.home');
    app.factory('highchartTheme', [
        function() {
            var thems = {
                light: function() {
                    if (!Highcharts.themeLight) {
                        Highcharts.themeLight = { //'#00B3F7', '#E94E51'
                            colors: ['#E94E51', '#0FBDFF', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
                            chart: {
                                backgroundColor: "#F7F7F7",
                                borderColor: 'transparent',
                                borderWidth: 0,
                                borderRadius: 5,
                                plotBackgroundColor: 'transparent',
                                plotBorderColor: 'transparent',
                                style: {
                                    fontFamily: '"Microsoft Yahei", Verdana', // default font
                                    fontSize: '11px',
                                    borderLeftBottomRaduis: "5px",
                                    borderRightBottomRaduis: "5px"
                                },
                                spacing: [40, 40, 40, 40],
                                margin: [30, 30, 50, 50]
                            },
                            title: {
                                style: {
                                    color: '#555',
                                    fontSize: '14px'
                                }
                            },
                            xAxis: {
                                gridLineColor: '#EBEBEB',
                                gridLineWidth: 1,
                                lineColor: '#9A9D8A',
                                tickColor: '#9A9D8A',
                                labels: {
                                    style: {
                                        color: '#717461',
                                        font: '12px  Verdana'
                                    }
                                },
                                title: {
                                    style: {
                                        color: '#717461',
                                        fontSize: '12px',
                                        fontFamily: '"Microsoft Yahei" , Verdana'

                                    }
                                }
                            },
                            yAxis: {
                                gridLineColor: '#EBEBEB',
                                gridLineWidth: 1,
                                lineColor: '#9A9D8A',
                                lineWidth: 1,
                                tickColor: '#9A9D8A',
                                labels: {
                                    style: {
                                        color: '#717461',
                                        font: '14px  Verdana'
                                    }
                                },
                                title: {
                                    style: {
                                        color: '#717461',
                                        fontSize: '14px',
                                        fontFamily: '"Microsoft Yahei" , Verdana'

                                    }
                                }
                            },
                            labels: {
                                style: {
                                    color: '#99b'
                                }
                            }
                        };
                    }
                    // Apply the theme
                    Highcharts.setOptions(Highcharts.themeLight);
                },
                transparent: function() {
                    if (!Highcharts.themeTransparent) {
                        Highcharts.themeTransparent = {
                            colors: ['#E94E51', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
                            chart: {
                                borderWidth: 0,
                                backgroundColor: '#333',
                                plotBackgroundColor: 'transparent',
                                plotBorderColor: 'transparent',
                                style: {
                                    borderBottomLeftRadius: "6px",
                                    borderTopLeftRadius: "6px"
                                },
                            },
                            title: {
                                style: {
                                    color: '#fff',
                                    font: '2rem Verdana',
                                    fontWeight: 'bolder'
                                }
                            },
                            xAxis: {
                                gridLineColor: 'tranparent',
                                labels: {
                                    style: {
                                        color: '#aaa',
                                        font: '12px Verdana'
                                    }
                                },
                                lineColor: '#aaa',
                                minorGridLineColor: '#505053',
                                tickColor: '#aaa',
                                title: {
                                    style: {
                                        color: '#aaa'
                                    }
                                }
                            },
                            yAxis: {
                                gridLineColor: '#707073',
                                labels: {
                                    style: {
                                        color: '#E0E0E3'
                                    }
                                },
                                gridLineWidth: 1,
                                lineColor: '#707073',
                                minorGridLineColor: '#707073',
                                tickColor: '#393939',
                                tickWidth: 0.5,
                                title: {
                                    style: {
                                        color: '#A0A0A3'
                                    }
                                }
                            },
                            labels: {
                                style: {
                                    color: '#99b'
                                }
                            }
                        };
                    }
                    // Apply the theme
                    Highcharts.setOptions(Highcharts.themeTransparent);
                }
            };
            return thems;
        }
    ]);
});
